package com.lantosec.hmrp.modules.system.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lantosec.hmrp.modules.system.entity.SendMessageBean;
import com.lantosec.hmrp.modules.system.entity.SysSmsLog;
import com.lantosec.hmrp.modules.system.mapper.SysSmsMapper;
import com.lantosec.hmrp.modules.system.service.ISysSmsService;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 * 区域表 服务实现类
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-24
 */
@Service
@Primary
@Log4j2
@SuppressWarnings("all")
public class SysSmsServiceImpl extends ServiceImpl<SysSmsMapper, SysSmsLog> implements ISysSmsService {
    @Override
    public Integer saveSmsLog(SendMessageBean entity) {
        SysSmsLog smsLog = new SysSmsLog();
        smsLog.setModuleId(entity.getModuleId());
        smsLog.setSmsContent(entity.getSmsContent());
        smsLog.setSmsPhone(entity.getPhone());
        smsLog.setSmsSendtime(new Date());
        smsLog.setSmsCode(entity.getSmsCode());
        baseMapper.insert(smsLog);
        return smsLog.getSmsLogId();
    }
}
